package pl.model;

import java.util.Calendar;
import java.util.GregorianCalendar;

import org.apache.tapestry.form.IPropertySelectionModel;

public class YearModel implements IPropertySelectionModel {

	   

    private final static int START_YEAR = 1900;

    private final static int END_YEAR =

          new GregorianCalendar().get(Calendar.YEAR);

   

    public String getLabel(int index) {

        return Integer.toString(index + START_YEAR);

    }

   

    public Object getOption(int index) {

        return index + START_YEAR;

    }

   

    public int getOptionCount() {

        return END_YEAR - START_YEAR + 1;

    }

   

    public String getValue(int index) {

        return "" + index;

    }

   

    public Object translateValue(String value) {

        return Integer.parseInt(value) + START_YEAR;

    }



	@Override
	public boolean isDisabled(int arg0) {
		// TODO Auto-generated method stub
		return false;
	}

   

}